import java.util.Scanner;

public class J20250323 {
    public static void main(String[] args) {
        System.out.println("请输入数字:");
        Scanner sc=new Scanner(System.in);
        int m=sc.nextInt();
        System.out.println(sum(m));
    }

    public static  int sum(int n) {
        if(n<10){
            return n;
        }
        return sum(n/10)+n%10;   //12   3      ***  1    2   ***

    }
}
